// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[4058.73,7807.62,0], [4069.67,7794.5,0], [4041.78,7848.86,0]]; //  steal tank prototype, Pobeda-Damm, array 2 and 3 = infantry and armor positions
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	#ifndef __TT__
	d_current_mission_text = "Enemy forces are testing an enhanced APC in Molisana. Your mission is to steal it and bring it to the flag at your base.";
	d_current_mission_resolved_text = "Good job. You got the enhanced tank version.  Too bad it smells like ass.";
	#endif
	#ifdef __TT__
	d_current_mission_text = "Enemy forces are testing an enhanced tank version at Alcazar. Your mission is it to destroy that tank.";
	d_current_mission_resolved_text = "Good job. The enhanced tank version is destroyed.";
	#endif
};

if (isServer) then {
	_xtank = switch (d_enemy_side) do {
		case "EAST": {"BTR90"};
		case "WEST": {"M1A2_TUSK_MG"};
		case "GUER": {"BTR90"};
	};
	__PossAndOther
	_pos_other2 = x_sm_pos select 2;
	_vehicle = objNull;
	_vehicle = _xtank createvehicle (_poss);
	_vehicle setDir 140;
	#ifndef __TT__
	sleep 2.123;
	["specops", 1, "basic", 1, _pos_other,100,true] spawn XCreateInf;
	sleep 2.321;
	["shilka", 1, "bmp", 1, "uaz_mg", 1, _pos_other2,1,200,true] spawn XCreateArmor;
	[_vehicle] execVM "x_missions\common\x_sidesteal.sqf";
	allunits_add set [count allunits_add, _vehicle];
	#endif
	#ifdef __TT__
	_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
	_vehicle lock true;
	sleep 2.123;
	["specops", 1, "basic", 1, _pos_other,100,true] spawn XCreateInf;
	sleep 2.321;
	["uaz_mg", 1, "brdm", 1, "tank", 0, _pos_other2,2,200,true] spawn XCreateArmor;
	#endif
};

if (true) exitWith {};